﻿namespace Arms.Framework.Objects.Geometry
{
    using System;

    [Serializable]
    public class Square : Polygon
    {
        private Coordinate _upperLeft;
        private Coordinate _lowerRight;

        /// <summary>
        /// The upper left coordinate of the square.
        /// </summary>
        public Coordinate UpperLeft
        {
            get { return _upperLeft; }
        }
        /// <summary>
        /// The lower right coordinate of the square.
        /// </summary>
        public Coordinate LowerRight
        {
            get { return _lowerRight; }
        }

        public Square(double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY)
            : this(new Coordinate(upperLeftX, upperLeftY), new Coordinate(lowerRightX, lowerRightY)) { }

        public Square(Coordinate upperLeftCoord, Coordinate lowerRightCoord)
            : base(upperLeftCoord, lowerRightCoord)
        {
            _upperLeft = upperLeftCoord;
            _lowerRight = lowerRightCoord;
        }
    }
}
